
{extend name="layout/base"}
{block name="title"}客服配置{/block}
{block name="css"}{/block}
{block name="head_js"}
<link href="__admin_static__/css/plugins/iCheck/custom.css" rel="stylesheet">
{/block}
{block name="body"}
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">

    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>客服配置　<small>您可以调整一些配置，用于初始化整个客服系统。</small><a target="_self" data-toggle="modal" data-target="#myModal"><span class="btn btn-w-m btn-primary"><i class="glyphicon glyphicon-plus"></i> 添加配置项</a></span></h5>
                    <div class="modal inmodal" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content animated bounceInRight">
                                <form action="{:url('add')}" enctype="multipart/form-data" target="_self" method="post">
                                    <div class="modal-header">
                                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
                                        </button>
                                        <i class="fa fa-pencil-square modal-icon"></i>
                                        <h4 class="modal-title">新增配置项</h4>
                                        <small class="font-bold">非开发人员请勿操作！</small>
                                    </div>
                                    <div class="modal-body">
                                        <div class="form-group"><label>类型</label></div>
                                        <style>
                                            .checkbox input{
                                                margin-top: 2px;
                                            }
                                        </style>
                                        <div class="checkbox">
                                            <label>
                                                <input type="radio" name="type" value="text" onclick="javascript: typeChange(this);" > text　
                                            </label>
                                            <label>
                                                <input type="radio" name="type" value="image" onclick="javascript: typeChange(this);" > image
                                            </label>
                                        </div>
                                        <div class="form-group"><label>cKey</label> <input type="text" name="cKey" placeholder="请输入cKey" class="form-control"></div>
                                        <div class="form-group"><label>cValue</label> <input type="hidden" name="cValue" placeholder="请输入cValue" class="form-control"></div>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                                        <button type="button" class="btn btn-primary" onclick="javascript:addConfig(this);">保存</button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>

                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                    <div class="clearfix" style="clear: both; "></div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form method="post" class="form-horizontal" action="{:url('Config/update')}" target="_self" enctype="multipart/form-data">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">网站域名</label>

                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="domain" placeholder="{$config.domain}">
                                <span class="help-block m-b-none">必填)：请输入网站域名</span>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">通信ip及端口</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="domain_ip" placeholder="{$config.domain_ip}">
                                <span class="help-block m-b-none">必填)：请输入用于客服系统的通讯ip及端口如：127.0.0.1:8282或者localhost:8282 (如果您是阿里云服务器，请开启8282端口)</span>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">客服紧急热线</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" name="kfphone" placeholder="{$config.kfphone}">
                                <span class="help-block m-b-none">必填)：请输入电话，方便有事情与您联系（如，接收短信，用户反馈等）</span>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">用户上线头像</label>
                            <div class="col-sm-10">
                                <input type="file" class=" btn btn-lg btn-primary" rows="3" name="userPhotoOnLine"  placeholder="{$config.userPhotoOnLine}">
                                <span class="help-block m-b-none">必填)：请选择图片jpg,png (正方形，50*50px 最合适噢) {if condition="!empty($config.userPhotoOnLine)"}<span data-toggle="modal" data-target="#userPhotoOnLine" class="text-navy">点击查看</span>{/if}</span>
                                <div class="modal inmodal" id="userPhotoOnLine" tabindex="-1" role="dialog" aria-hidden="true">
                                    <div class="modal-dialog">
                                        <div class="modal-content animated bounceInRight">
                                            <div class="modal-body">
                                                <img src="{$domain}/{$config.userPhotoOnLine}" style="max-width: 80%;display: block;margin: 0 auto;">
                                            </div>
                                            <div class="modal-footer">
                                                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">用户离线头像</label>
                            <div class="col-sm-10">
                                <input type="file" class=" btn btn-lg btn-primary" rows="3" name="userPhotoOffLine"  placeholder="{$config.userPhotoOffLine}">
                                <span class="help-block m-b-none">必填)：请选择图片jpg,png (正方形，50*50px 最合适噢) {if condition="!empty($config.userPhotoOffLine)"}<span data-toggle="modal" data-target="#userPhotoOffLine"  class="text-navy">点击查看</span>{/if}</span>
                                <div class="modal inmodal" id="userPhotoOffLine" tabindex="-1" role="dialog" aria-hidden="true">
                                    <div class="modal-dialog">
                                        <div class="modal-content animated bounceInRight">
                                            <div class="modal-body">
                                                <img src="{$domain}/{$config.userPhotoOffLine}" style="max-width: 80%;display: block;margin: 0 auto;">
                                            </div>
                                            <div class="modal-footer">
                                                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">客服上线头像</label>
                            <div class="col-sm-10">
                                <input type="file" class=" btn btn-lg btn-primary" rows="3" name="kfPhotoOnLine"  placeholder="{$config.kfPhotoOnLine}">
                                <span class="help-block m-b-none">必填)：请选择图片jpg,png (正方形，50*50px 最合适噢) {if condition="!empty($config.kfPhotoOnLine)"}<span data-toggle="modal" data-target="#kfPhotoOnLine"  class="text-navy">点击查看</span>{/if}</span>
                                <div class="modal inmodal" id="kfPhotoOnLine" tabindex="-1" role="dialog" aria-hidden="true">
                                    <div class="modal-dialog">
                                        <div class="modal-content animated bounceInRight">
                                            <div class="modal-body">
                                                <img src="{$domain}/{$config.kfPhotoOnLine}" style="max-width: 80%;display: block;margin: 0 auto;">
                                            </div>
                                            <div class="modal-footer">
                                                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">客服离线头像</label>
                            <div class="col-sm-10">
                                <input type="file" class=" btn btn-lg btn-primary" rows="3" name="kfPhotoOffLine"  placeholder="{$config.kfPhotoOffLine}">
                                <span class="help-block m-b-none">必填)：请选择图片jpg,png (正方形，50*50px 最合适噢) {if condition="!empty($config.kfPhotoOffLine)"}<span data-toggle="modal" data-target="#kfPhotoOffLine"  class="text-navy">点击查看</span>{/if}</span>
                                <div class="modal inmodal" id="kfPhotoOffLine" tabindex="-1" role="dialog" aria-hidden="true">
                                    <div class="modal-dialog">
                                        <div class="modal-content animated bounceInRight">
                                            <div class="modal-body">
                                                <img src="{$domain}/{$config.kfPhotoOffLine}" style="max-width: 80%;display: block;margin: 0 auto;">
                                            </div>
                                            <div class="modal-footer">
                                                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button class="btn btn-danger" type="submit">确定配置</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>



<script src="__admin_static__/js/jquery.min.js?v=2.1.4"></script>
<script src="__admin_static__/js/bootstrap.min.js?v=3.3.5"></script>
<script src="__admin_static__/js/content.min.js?v=1.0.0"></script>
<script src="__admin_static__/js/plugins/iCheck/icheck.min.js"></script>
<script src="__admin_static__/js/base.js"></script>
<script>
    $(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});
    function addConfig(target)
    {
        $(target).parents('form').submit();
    }

    function typeChange(target)
    {
        var type = $(target).val();
        var cValue = $('input[name=cValue]');
        switch (type)
        {
            case'text' :
                cValue.attr('type','text');
                break;
            case 'image':
                cValue.attr('type','file');
                break;
        }
    }
</script>
<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
</body>
{/block}
